#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import with_statement
import os, sys
os.system("chmod -R a+rX *")

with open("list", "r") as f:
	lines=f.readlines()
	for line in lines:
		c=line.split()
		if len(c)>=2 and not os.path.exists(c[1]):
		    print '%s not exist.'%c[1]
		    sys.exit(0)

with open("list", "w") as f:
	for line in lines:
		c=line.split()
		if len(c)<2:
			f.write(line)
		else:
			f.write("%-22s%-70s %d\n"%(c[0], c[1], os.stat(c[1]).st_size))
			#print "%-22s%-65s %d\n"%(c[0], c[1], os.stat(c[1]).st_size)
